﻿#region File Description
//-----------------------------------------------------------------------------
// SupportTowerInfo.cs
//
// Attack of the Crazy Pixels
// Copyright (c) 2009 VosSoft
//-----------------------------------------------------------------------------
#endregion
#region License
//-----------------------------------------------------------------------------
// The MIT License (MIT)
//
// Copyright (c) 2009 VosSoft
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
#endregion

namespace Attack_of_the_Crazy_Pixels
{
    /// <summary>
    /// Holds all informations of a SupportTower.
    /// </summary>
    public sealed class SupportTowerInfo : TowerInfo
    {
        public float[] RangeMultiplier { get; private set; }
        public float[] DamageMultiplier { get; private set; }
        public float[] FireRateMultiplier { get; private set; }
        public float[] SplashRangeMultiplier { get; private set; }

        public SupportTowerInfo(string name, Texture2D texture, Color? color, Vector2? size, int maxUpgradeLevel, float[] range,
            int[] costs, float[] rangeMultiplier, float[] damageMultiplier, float[] fireRateMultiplier, float[] splashRangeMultiplier)
            : base(TowerType.SupportTower, name, texture, color, size, maxUpgradeLevel, range, costs)
        {
            RangeMultiplier = rangeMultiplier;
            DamageMultiplier = damageMultiplier;
            FireRateMultiplier = fireRateMultiplier;
            SplashRangeMultiplier = splashRangeMultiplier;

            for (int i = 0; i < RangeMultiplier.Length; i++)
            {
                if (RangeMultiplier[i] == 0.0f)
                {
                    RangeMultiplier[i] = 1.0f;
                }
            }

            for (int i = 0; i < DamageMultiplier.Length; i++)
            {
                if (DamageMultiplier[i] == 0.0f)
                {
                    DamageMultiplier[i] = 1.0f;
                }
            }

            for (int i = 0; i < RangeMultiplier.Length; i++)
            {
                if (RangeMultiplier[i] == 0.0f)
                {
                    RangeMultiplier[i] = 1.0f;
                }
            }

            for (int i = 0; i < SplashRangeMultiplier.Length; i++)
            {
                if (SplashRangeMultiplier[i] == 0.0f)
                {
                    SplashRangeMultiplier[i] = 1.0f;
                }
            }

            Tower = new SupportTower(this, Vector2.Zero, null);
        }
    }
}
